package stream.Demo02;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @Author Miku
 * @Create 2021/4/29 14:31
 * FileOutputStream
 * 文件字节输出流
 */
public class Test {
    public static void main(String[] args) throws IOException {
        //1.创建文件字节输出流对象
        FileOutputStream fos = new FileOutputStream("e:\\bbb.txt");
        //2.写入文件
//        fos.write(97);
//        fos.write('b');
//        fos.write('c');
        String s = "Hello World";
        fos.write(s.getBytes());
        //3.关闭
        fos.close();
        System.out.println("执行完毕");
    }
}
